﻿<html>

	<head>
		<meta charset="utf-8">
		<meta name="format-detection" content="telephone=no">
		<meta name="viewport" content="minimal-ui=yes,width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	
		<title>{$store_info.title}</title>
		<meta name="Keywords" content="{$type_info['label']},{$store_info.keywords}" />
		<meta name="Description" content="{$type_info['label']},{$store_info.keywords}" />
		<link rel="stylesheet" type="text/css" href="__TMPL__Public/css/public.css" />
		<link rel="stylesheet" type="text/css" href="__TMPL__Public/css/category.css" />
		<link rel="stylesheet" href="/themes/wnsc_moblie/newMobile/Store/css/left.css">
		<script type="text/javascript" src="__TMPL__Public/js/jquery.js"></script>
		<script type="text/javascript" src="__TMPL__Public/js/jquery.json.js"></script>
		<script type="text/javascript" src="__TMPL__Public/js/transport.js"></script>
		<script type="text/javascript" src="__TMPL__Public/js/common.js"></script>
		<script src="/themes/wnsc_moblie/newMobile/Shop/js/layer.js"></script>
		<script type="application/javascript" src="__TMPL__Public/js/jquery.more.js"></script>
	</head>

	<body class="body_bj">
		<section class="_pre">
			<php>
				$agent = $_SERVER['HTTP_USER_AGENT'];
				if(strpos($agent,"Html5Plus") === false){
					if($_GET['id']){
						$height= 'height: 130px;';
					}else{
						$height= 'height: 85px;';
					}
				}else{
					echo "<style>.shopheader-main{top:0!important;}</style>";
					$height= 'height: 85px;';
				}

			</php>
			<header class="header" style=" position:fixed; top:0; {$height}border-bottom: 1px solid #eee;">
				<?php
					$agent = $_SERVER['HTTP_USER_AGENT'];
					if(strpos($agent,"Html5Plus") === false){
				?>
				<div class="tab_nav" style="border-bottom: 1px solid #eee;height: 45px;">
					<div class="h-left">
						<a class="sb-back" href="javascript:history.back(-1)" title="返回"></a>
					</div>
					<div class="h-mid">{$store_info.title}</div>
					<div class="h-right">
						<aside class="top_bar">
							<div class="show-menu" id="show_more" style=" cursor: pointer;">
								<a href="javascript:;"></a>
							</div>
						</aside>
					</div>
				</div>
				<?php
					}
				?>
				<div class="shopheader-main" style="padding: 16px 0;height: auto;">
					<img class="shopheader-logo"src="{$store_template_info.logo}" alt="{$store_info.title}" onclick="location.href='{:U("store/index",array("id"=>$_GET["id"]))}'">

					<div class="shopheader-content">
						<h2 class="shopheader-name" style="color: #000;" onclick="location.href='{:U("store/index",array("id"=>$_GET["id"]))}'">{$store_info.title}</h2>

						<div class="shopheader-activities">
							<ul>
								<li>
									<div class="activity-wrap nowrap">
                            <span class="activity-description" style="color: #000;">公告：{$store_info.notice}  </span>
									</div>
								</li>
							</ul>

								<php>if($rsstoreinfo_status==1){</php>
									<div class="shopheader-activity-count SZY-SHOP-IS-COLLENT" data-shop_id="{$_GET['id']}" style="color: #fff;background: #f00;">
										<i class="i-favorite"></i>已收藏
									</div>
								<php>}else{</php>
									<div class="shopheader-activity-count SZY-SHOP-IS-COLLENT" data-shop_id="{$_GET['id']}" style="color: #fff;">
										<i class="i-favorite"></i>收藏
									</div>
								<php>}</php>

						</div>
					</div>
				</div>
				<script type="text/javascript">
                    $(function(){
                        $('.SZY-SHOP-IS-COLLENT').click(function(){
                            var store_id=$(this).attr('data-shop_id');
                            $.post('/user/collect', {
                                id: store_id,
                                type: 2,
                            }, function(result) {
                                if(result.code == 1) {
                                    layer.msg(result.message);
                                    $('.SZY-SHOP-IS-COLLENT').css('background','#f00');
                                    $('.SZY-SHOP-IS-COLLENT').css('color','#fff');
                                    $('.SZY-SHOP-IS-COLLENT').html('<i class="i-favorite"></i>已收藏')
                                } else {
                                    layer.msg(result.message);

                                    $('.SZY-SHOP-IS-COLLENT').css('background','#CCCCCC');
                                    $('.SZY-SHOP-IS-COLLENT').html('<i class="i-favorite"></i>收藏')
                                }
                            }, "json");
                        })
                    })

				</script>
			</header>
			<mtc_include file="Public:right_nav" />
			<?php
					$agent = $_SERVER['HTTP_USER_AGENT'];
					if(strpos($agent,"Html5Plus") === false){
						echo '<div style="height:130px;" class="empty_div">&nbsp;</div>';
					}else{
						echo '<div style="height:90px;" class="empty_div">&nbsp;</div>';
					}
				?>


			<php>
				$tree=sp_get_store_menu_tree($_GET['id']);
			</php>
			<div class="category1" style="outline: none; overflow: hidden; position: fixed;" tabindex="5000">
				<ul class="clearfix">

					<li <eq name="_GET['shop_id']" VALUE="0"> class="cur" </eq>>	<a href="{:U('store/type',array('id'=>$_GET['id'],'shop_id'=>0))}" >全部商品 </a></li>
					<foreach name="tree" item="vo">
						<li  <eq name="_GET['shop_id']" VALUE="$vo['id']"> class="cur" </eq>>	<a href="{:U('store/type',array('id'=>$_GET['id'],'shop_id'=>$vo['id']))}">{$vo.label} </a>	</li>
					</foreach>
					<li style="border:none;"> </li>
					<li style="border:none;"> </li>
					<li style="border:none;"> </li>
					<li style="border:none;"> </li>
				</ul>
			</div>
			<div style="width: 75%;float: right">
			<section class="filtrate_term" id="product_sort" style="width: 100%;float: right; z-index:9999; border-bottom:1px solid #CCC">
				<ul>
					<php>$orders=I('get.order',0);</php>
					<li <eq name="orders" value="0">class="on"</eq>> 
						<a href="{:U('store/type',array('id'=>$_GET['id'],'shop_id'=>$_GET['shop_id'],'order'=>0))}">最新</a>
					</li>
					<li <eq name="orders" value="1">class="on"</eq>>
						<a href="{:U('store/type',array('id'=>$_GET['id'],'shop_id'=>$_GET['shop_id'],'order'=>1))}">销量</a>
					</li>
					<li <eq name="orders" value="2">class="on"</eq>>
						<a href="{:U('store/type',array('id'=>$_GET['id'],'shop_id'=>$_GET['shop_id'],'order'=>2))}">热门</a>
					</li>
					<li <eq name="orders" value="3">class="on"</eq> <eq name="orders" value="4">class="on"</eq>>
						<php>
							if($orders==3){
						</php>
							<a href="{:U('store/type',array('id'=>$_GET['id'],'shop_id'=>$_GET['shop_id'],'order'=>4))}">价格<span class="arrow_up "></span><span class="arrow_down  <eq name='orders' value='3'>active_down</eq>"></span></a>
						<php>}else{</php>
						
							<a href="{:U('store/type',array('id'=>$_GET['id'],'shop_id'=>$_GET['shop_id'],'order'=>3))}">价格<span class="arrow_up <eq name='orders' value='4'>active_up</eq>"></span><span class="arrow_down"></span></a>
						<php>}</php>
						
					</li>

				</ul>
			</section>
			</div>
			<div style="height:5px;float: right;width: 75%;"></div>
			<script type="text/javascript">
				var url = "{:U('store/ajax_type',array('id'=>$_GET['id'],'shop_id'=>$_GET['shop_id'],'order'=>$_GET['order'],'daiyan'=>$_GET['types']))}";
				$(function() {
					$('#J_ItemList').more({
						'address': url
					});
				});
			</script>
		
			</div>
		</section>
	
		<div class="touchweb-com_searchListBox" id="goods_list">
				<form action="javascript:void(0)" method="post" name="ECS_FORMBUY" id="ECS_FORMBUY">
					<div id="J_ItemList" style="opacity: 1;">
						<div class="product single_item info"></div>
						<a href="javascript:;" class="get_more">
						</a>
					</div>
				</form>
				

			</div>
			</div>
		<script type="text/javascript" src="__TMPL__Public/js/zepto.min.js"></script>
		<script type="text/javascript" src="__TMPL__Public/js/filter.min.js"></script>
		<script>
			$(document).ready(function() {
				//筛选浮层显示控制
				var filtrate = $(".filtrate"),
					submit = $(".submit,.back,.reset");
				filtrate.bind("click", function() {
					$("._next").show();
					$("._pre").hide();
					window.scrollTo(0, 0);
				});
				submit.bind("click", function() {
					$("._next").hide();
					$("._pre").show();
				});
				//初始化筛选浮层
				bizFilter.init();
			});
		</script>
		<script>
			$(function() {
				//搜索浮层显示逻辑
				var sbox = $("#head_search_box"),
					sort = $('#product_sort'),
					g_list = $("#goods_list"),
					g_m1 = "0",
					g_m2 = "96px";
				var initCss = function(type) {
					if(type == 1) {
						sort.css({
							"position": "static",
							"width": "100%"
						});
						g_list.css("margin-top", g_m1);

					} else {
						sort.attr("style", "");
						g_list.css("margin-top", g_m2);

					}
				};
				var m = {
					input: $("#keyword"),
					rawAll: '',
					dd: $(".text_box"),
					cancel: $(".mix_back"),
					rawKey: '请输入商品名称',
					main: function() {
						this.init();
						this.be();
					},
					init: function() {
						this.rawAll = this.input.val();
					},
					be: function() {
						var _this = this;
						this.input.focus(function() {
								var mix_search = $("#mix_search_div");
								if(mix_search.length > 0) {
									$("._pre").hide();
									mix_search.show();
									$("#keyword1").focus();
									return;
								}
								var newKey = _this.input.val();
								if(newKey != _this.rawKey && newKey != _this.rawAll) {
									$(this).val(newKey);
								} else {
									$(this).val(_this.rawKey);
								}
								if($(window).scrollTop() > 0) {
									initCss(1);
									window.scrollTo(0, 0);
									_this.dd.trigger("click"); //for ddclick
								}
							})
							.blur(function() {
								var newKey = _this.input.val();
								if(newKey === _this.rawKey) {
									$(this).val(_this.rawAll);
								} else {
									$(this).val(newKey);
								}
							});
						this.cancel.bind("click", function() {
							$("#mix_search_div").hide();
							$("._pre").show();
						});
						
					}
				};
				m.main();
				$(window).resize(function() {
					sbox.css("width", "100%");
					sort.css("width", "100%");
				});
				//顶部sticky效果
				setTimeout(function() {
					var sboxH = sbox.height();
					var sortH = sort.height();
					var sortStart = sort.offset().top - sboxH;
					var showEnd = sort.offset().top;
					var init = function() {
						sbox.css({
							"position": "fixed",
							"top": "0",

						});
						window.scrollTo(0, 0);
					};
					var rawScroll = 0,
						nowScroll = 0;
					var upOrDown = function() {
						var delta = 30;
						if(nowScroll > rawScroll + delta) {
							return 1;
						} else if(nowScroll < rawScroll - delta) {
							return 2;
						} else {
							return 0;
						}
					};
					var sticky = function() {
						nowScroll = $(window).scrollTop();
						if(nowScroll >= sortStart) {


							g_list.css({
								"margin-top": sortH,
								"margin-bottom": sortH
							});
						} else {
							sort.attr("style", "");
							g_list.attr("style", "");
						}
						if(nowScroll > showEnd + sortH) {
							var up = upOrDown();
							if(up == 1) {
								if(sbox.css("display") != "none") {
									sbox.hide();
									sort.hide();
								}
								rawScroll = nowScroll;
							} else if(up == 2) {
								if(sbox.css("display") == "none") {
									sbox.show();
									sort.show();
								}
								rawScroll = nowScroll;
							}
						} else {
							if(sbox.css("display") == "none") {
								sbox.show();
								sort.show();
							}
						}
					};
					init();
					$(document).on("touchmove", sticky);
					$(window).on("scroll", sticky);
				}, 500);

			});
		</script>
		<script>
			$('.show_type').bind("click", function() {
				if($('#goods_list').hasClass('openList')) {
					$('#goods_list').removeClass('openList');
					$(this).removeClass('show_list');
				} else {
					$('#goods_list').addClass('openList');
					$(this).addClass('show_list');
				}
			});
		</script>
	
		<script type="Text/Javascript" language="JavaScript">
			function selectPage(sel)
			{
			  sel.form.submit();
			}
		</script>
		<mtc_include file="Public:footer" />
		<script>
			function goTop() {
				$('html,body').animate({
					'scrollTop': 0
				}, 600);
			}
		</script>
		<a href="javascript:goTop();" class="gotop" style=" z-index:9999"><img src="__TMPL__Public/picture/topup.png"></a>
	</body>

</html>